#ifndef OBJECTID_H
#define OBJECTID_H

class QUINCE_CORE_EXPORT ObjectId
{
public:
    ObjectId();
    explicit ObjectId(unsigned int v) : m_value(v) {}

    void setValue(unsigned int v) { m_value = v; }
    unsigned int value() const { return m_value; }

    operator unsigned int() const { return m_value; }

    bool operator == (const ObjectId &other) const {
        return m_value == other.m_value;
    }

    bool operator != (const ObjectId &other) const {
        return m_value != other.m_value;
    }

    bool operator < (const ObjectId &other) const {
        return m_value < other.m_value;
    }
private:
    unsigned int m_value;
    static unsigned int s_nextValue;
};

QUINCE_CORE_EXPORT QDataStream & operator <<(QDataStream &out, const ObjectId &);
QUINCE_CORE_EXPORT QDataStream & operator >>(QDataStream &in, ObjectId &);

#endif // OBJECTID_H
